<template>
  <div>
    <div>two组件</div>
    <h2>{{ count }}</h2>
    <button @click="$forceUpdate()">强制更新</button>
    <button @click="changeA">更新a</button>
  </div>
</template>

<script>
var a = [1]
var b = 1
export default {
  name: "Two",
  data() {
    return {
      count:a
    }
  },
  methods: {
    changeA(){
      b++
      a.push(b)
    }
  },
  mounted() {
    console.log("mounted 挂载了");
  },
  updated() {
    console.log("updated 更新了");
  },


};
</script>

<style scoped>
p{
  color: tomato;
}
</style>
